<?php
/*
 * This file is part of SoftSite.
 *
 * (c) 2012 Steve Tredinnick
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

/**
 *
 *
 * @package softsite
 * @author  Steve Tredinnick <steve.tredinnick@gmail.com>
 */

namespace Lib\Forms\Elements;

use Lib\Forms\Elements\InputElement;

class ImageElement extends InputElement
{
    public function __construct($name)
    {
        parent::__construct();
        $this->SetType("image");
        $this->SetName($name);
    }

    private function ValidateHTML()
    {

    }

    /**
     * @desc Returns the generated HTML for the view.
     * @return string Generated HTML for the view.
     */
    public function RenderElement()
    {
        $this->GenerateHtml();
        return $this->formHtml;
    }

    public function SetAlt($alt)
    {
        parent::SetAlt($alt);
    }

    public function SetHeight($height)
    {
        parent::SetHeight($height);
    }

    /**
     * The src attribute specifies the URL of the image to use as a submit button.
     * Note: The src attribute is required for <input type="image">, and can only be used with <input type="image">.
     *
     * @param $src
     */
    public function SetSrc($src)
    {
        parent::SetSrc($src);
    }

    /**
     * The width attribute specifies the width of the <input> element.
     *
     * Note: The width attribute is used only with <input type="image">.
     *
     * Tip: Always specify both the height and width attributes for images.
     *
     * If height and width are set, the space required for the image is reserved when the page is loaded.
     * However, without these attributes, the browser does not know the size of the image, and cannot reserve the appropriate space to it.
     * The effect will be that the page layout will change during loading (while the images load).
     *
     * @param $width
     */
    public function SetWidth($width)
    {
        parent::SetWidth($width);
    }

}
